package com.xiguthings.waka.service.task.impl;

import java.util.List;

import com.xiguthings.waka.dao.mapper.PaperTaskMapper;
import com.xiguthings.waka.po.PaperTask;
import com.xiguthings.waka.po.PaperTaskExample;
import com.xiguthings.waka.publicUtils.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.xiguthings.waka.po.extpo.Page;
import com.xiguthings.waka.service.task.ITaskService;

import javax.annotation.Resource;

@Service
@Transactional
public class TaskServiceImpl implements ITaskService {
    @Resource
    PaperTaskMapper paperTaskMapper;

    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public int countByExample(PaperTaskExample example) throws Exception {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int deleteByExample(PaperTaskExample example) throws Exception {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int deleteByPrimaryKey(String id) throws Exception {

        return paperTaskMapper.deleteByPrimaryKey(id);
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int insert(PaperTask t) throws Exception {
        String id = StringUtils.getRandomUUID();
        t.setTaskId(id);
        int row = paperTaskMapper.insert(t);
        return row;
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int insertSelective(PaperTask t) throws Exception {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public List<PaperTask> selectByExample(PaperTaskExample example) throws Exception {
        List<PaperTask> list = paperTaskMapper.selectByExample(example);
        return list;
    }

    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public PaperTask selectByPrimaryKey(String id) throws Exception {

        return paperTaskMapper.selectByPrimaryKey(id);
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int updateByExampleSelective(PaperTask t, PaperTaskExample example) throws Exception {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int updateByExample(PaperTask t, PaperTaskExample example) throws Exception {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int updateByPrimaryKeySelective(PaperTask t) throws Exception {
        int row = paperTaskMapper.updateByPrimaryKeySelective(t);
        return row;
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int updateByPrimaryKey(PaperTask t) throws Exception {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public Page selectByPage(Page pageEntity, PaperTaskExample example) throws Exception {
        // TODO Auto-generated method stub
        return null;
    }

}
